package org.rcloud.io.service.impl;

import org.rcloud.io.Utils.ResultVo;
import org.rcloud.io.mapper.PathWayMapper;
import org.rcloud.io.model.PathWay;
import org.rcloud.io.service.PathWayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2019/3/7.
 */
@Service(value="PathWayService")
public class PathWayServiceImpl implements PathWayService{

    @Autowired
    private PathWayMapper pathWayMapper;

    @Override
    public ResultVo save(PathWay pathWay) {

        if (pathWay.equals("") || pathWay == null) {
            return ResultVo.setError("传入数据为空");
        } else {
            try {
                pathWayMapper.insertSelective(pathWay);
                return ResultVo.setOK(null);
            } catch (Exception e) {
                e.printStackTrace();
                return ResultVo.setError(e.getMessage());
            }
        }

    }
}
